package com.example.spring.boot.business.user.impl;

import com.example.spring.boot.business.user.UserModel;
import com.example.spring.boot.repository.user.UserEntity;
import org.springframework.stereotype.Component;

import javax.swing.text.html.parser.Entity;

@Component
public class CreateUserBusinessConvert {

    public UserEntity toUserEntity(UserModel userModel){
        return  UserEntity.createBy(userModel);
    }

    public UserModel toUserModel(UserEntity entity,UserModel userModel){
        userModel.setUserName(entity.getUserName());
        userModel.setCreateTime(entity.getCreateTime());
        userModel.setUserId(entity.getUserId());
        return userModel;
    }
}
